export default {
	keyList: {},
	canDoFunction(options = {}) {
		if (!this.keyList[options.key]) {
			this.lockKey(options.key);
			options.success && options.success();
			if (options.time) {
				setTimeout(() => {
					this.releaseKey(options.key)
				}, options.time);
			}
		} else {
			options.fail && options.fail()
		}
	},
	releaseKey(key) {
		this.keyList[key] = false;
	},
	lockKey(key) {
		this.keyList[key] = true;
	}
}
